.blog-detail,
.blog-list {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

/* 博客头部样式 */
.blog-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #eaecef;
  
  h1 {
    margin-bottom: 16px;
    font-size: 2.5em;
    font-weight: 700;
    line-height: 1.2;
    color: #24292e;
  }
}

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.blog-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: #6a737d;
  
  .anticon {
    font-size: 14px;
  }
}

/* 博客标签样式 */
.blog-tags {
  margin: 24px 0;
  
  .ant-tag {
    margin-bottom: 8px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    border: none;
  }
}

/* 博客操作按钮 */
.blog-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #eaecef;
}

/* 博客详情页面布局 */
.blog-content-with-nav {
  display: flex;
  gap: 32px;
  position: relative;
}

/* 文章内容区域 */
.markdown-content {
  flex: 1;
  min-width: 0;
  
  /* Markdown 内容样式 */
  h1, h2, h3, h4, h5, h6 {
    margin-top: 32px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: #24292e;
    
    &:first-child {
      margin-top: 0;
    }
  }
  
  h1 {
    font-size: 2em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
  }
  
  h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
  }
  
  h3 {
    font-size: 1.25em;
  }
  
  h4 {
    font-size: 1em;
  }
  
  h5 {
    font-size: 0.875em;
  }
  
  h6 {
    font-size: 0.85em;
    color: #6a737d;
  }
  
  p {
    margin-bottom: 16px;
    line-height: 1.6;
    color: #24292e;
  }
  
  ul, ol {
    margin-bottom: 16px;
    padding-left: 2em;
    
    li {
      margin-bottom: 4px;
      line-height: 1.6;
    }
  }
  
  blockquote {
    margin: 16px 0;
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    background-color: #f6f8fa;
    border-radius: 0 6px 6px 0;
    
    p {
      margin-bottom: 0;
    }
  }
  
  table {
    border-collapse: collapse;
    margin: 16px 0;
    width: 100%;
    
    th, td {
      padding: 6px 13px;
      border: 1px solid #dfe2e5;
    }
    
    th {
      background-color: #f6f8fa;
      font-weight: 600;
    }
    
    tr:nth-child(2n) {
      background-color: #f6f8fa;
    }
  }
  
  img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 16px 0;
  }
  
  hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: #e1e4e8;
    border: 0;
    border-radius: 2px;
  }
  
  /* 内联代码样式 */
  code:not(.hljs) {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    color: #e83e8c;
  }
  
  /* 链接样式 */
  a {
    color: #0366d6;
    text-decoration: none;
    
    &:hover {
      text-decoration: underline;
    }
  }
}

/* 右侧导航栏 */
.sidebar-nav {
  width: 250px;
  position: sticky;
  top: 80px;
  align-self: flex-start;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 导航标题 */
.nav-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

/* 导航项容器 */
.nav-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 导航项 */
.nav-item {
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  transition: all 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 活动状态的导航项 */
.nav-item.active {
  background-color: #e6f7ff;
  color: #1890ff;
  font-weight: 500;
}

/* 鼠标悬停效果 */
.nav-item:hover {
  background-color: #f5f5f5;
  color: #40a9ff;
}

/* 确保markdown标题平滑滚动 */
.markdown-heading {
  scroll-margin-top: 100px;
  transition: color 0.3s ease;
}

/* 响应式调整 */
@media (max-width: 1024px) {
  .blog-content-with-nav {
    flex-direction: column;
    gap: 24px;
  }
  
  .sidebar-nav {
    width: 100%;
    position: static;
    max-height: none;
    order: -1;
  }
  
  .blog-header h1 {
    font-size: 2em;
  }
  
  .blog-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .blog-detail,
  .blog-list {
    padding: 16px;
  }
  
  .blog-header h1 {
    font-size: 1.75em;
  }
  
  .markdown-content {
    h1 {
      font-size: 1.5em;
    }
    
    h2 {
      font-size: 1.25em;
    }
    
    h3 {
      font-size: 1.125em;
    }
  }
  
  .code-block-wrapper {
    margin: 12px -16px;
    border-radius: 0;
  }
  
  .hljs {
    padding: 12px;
    font-size: 13px;
  }
  
  .blog-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  .blog-meta-item {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .blog-detail,
  .blog-list {
    padding: 12px;
  }
  
  .blog-header h1 {
    font-size: 1.5em;
  }
  
  .markdown-content {
    h1 {
      font-size: 1.25em;
    }
    
    h2 {
      font-size: 1.125em;
    }
  }
  
  .code-block-header {
    padding: 6px 12px;
    font-size: 11px;
  }
  
  .hljs {
    padding: 8px;
    font-size: 12px;
  }
}

/* 滚动条样式 */
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 代码块包装器 */
.code-block-wrapper {
  position: relative;
  margin: 16px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: #f6f8fa;
}

/* 代码块头部 */
.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #f1f3f4;
  border-bottom: 1px solid #e1e4e8;
  font-size: 12px;
  color: #586069;
}

.code-language {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.copy-button {
  color: #586069 !important;
  transition: all 0.2s ease;
  
  &:hover {
    color: #0366d6 !important;
    background-color: rgba(3, 102, 214, 0.1) !important;
  }
}

/* 代码高亮样式 */
.hljs {
  display: block;
  overflow-x: auto;
  padding: 16px;
  background: #f6f8fa;
  color: #24292e;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px;
  line-height: 1.5;
  border: none;
  margin: 0;
}

/* Markdown pre 样式 */
.markdown-pre {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  overflow: visible;
}

.hljs-comment,
.hljs-quote {
  color: #6a737d;
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
  color: #d73a49;
  font-weight: bold;
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
  color: #005cc5;
}

.hljs-string,
.hljs-doctag {
  color: #032f62;
}

.hljs-title,
.hljs-section,
.hljs-selector-id {
  color: #6f42c1;
  font-weight: bold;
}

.hljs-subst {
  font-weight: normal;
}

.hljs-type,
.hljs-class .hljs-title {
  color: #6f42c1;
}

.hljs-tag,
.hljs-name,
.hljs-attribute {
  color: #22863a;
  font-weight: normal;
}

.hljs-regexp,
.hljs-link {
  color: #032f62;
}

.hljs-symbol,
.hljs-bullet {
  color: #005cc5;
}

.hljs-built_in,
.hljs-builtin-name {
  color: #005cc5;
}

.hljs-meta {
  color: #6f42c1;
  font-weight: bold;
}

.hljs-deletion {
  background: #ffeef0;
}

.hljs-addition {
  background: #f0fff4;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: bold;
}